﻿using System.Collections.Generic;
using System.Linq;

namespace PortalCurriculo.Domain
{
    public partial class Link : ILink
    {
        public enum DivLocation
        {
            Top,
            Left,
            Right,
            Center,
        }

        public List<Link> SelecionarPorTipoUsuario(TipoUsuario.Tipo tipoUsuario, DivLocation div)
        {
            string divString = div.ToString();

            return (from link in Context.Instance.Links
                    where link.IdTipoUsuario == (int)tipoUsuario
                          && link.Div.Equals(divString)
                          && link.Ativo
                    select link).ToList();
        }
    }
}
